#ifndef SEL_H
#define SEL_H

#include<iostream>
#include<fstream>

using namespace std;

#include "Matriz.h"
#include "VectorMath.h"

template<class T>
class SEL{
       
    friend ostream & operator<<( ostream & sal , const SEL<T> & sist ){
        sal << sist.getRes().size() << endl;
        
        for(unsigned i = 0; i < sist.getRes().size(); i++)
            sal << sist.getRes()[i] << endl;
        
        sal << sist.error() << endl << endl;
        
        return sal;
    }

    private:
            VectorMath<T> tInd;
            VectorMath<T> resultados;
            Matriz<T> mat;
    
    public:
            SEL(int n = 1);
            SEL(const char * archivoIN);
            ~SEL();
            
            bool resolver();
            bool resolverPorInv();
            T error()const;
    
            VectorMath<T> getRes()const;
            VectorMath<T> getTInd()const;
            Matriz<T> & getMat();

            void setTInd(int i, T valor);
            void setMat(int i, int j, T valor);
            
            string toString();
            static bool test();
};

template class SEL<float>;
template class SEL<double>;
template class SEL<long double>;

#endif
